package gui;

import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JButton;
import javax.swing.JTextField;
import javax.swing.JPasswordField;
import javax.swing.JLabel;

public class Login {

	private JFrame frame;
	private JButton btnLogin;
	private JButton btnRegistrati;
	private JButton btnEsci;
	private JTextField txtUsername;
	private JPasswordField pwdPassword;
	private JLabel lblTitolo;
	private JLabel lblUsername;
	private JLabel lblPassword;
	private JButton button;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					Login window = new Login();
					window.frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the application.
	 */
	public Login() {
		initialize();
	}

	/**
	 * Initialize the contents of the frame.
	 */
	private void initialize() {
		frame = new JFrame();
		frame.setBounds(100, 100, 450, 300);
		frame.getContentPane().setLayout(null);
		frame.getContentPane().add(getBtnLogin());
		frame.getContentPane().add(getBtnRegistrati());
		frame.getContentPane().add(getBtnEsci());
		frame.getContentPane().add(getTxtUsername());
		frame.getContentPane().add(getPwdPassword());
		frame.getContentPane().add(getLblTitolo());
		frame.getContentPane().add(getLblUsername());
		frame.getContentPane().add(getLblPassword());
		frame.getContentPane().add(getButton());
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	}
	private JButton getBtnLogin() {
		if (btnLogin == null) {
			btnLogin = new JButton("Login");
			btnLogin.setBounds(113, 167, 117, 29);
		}
		return btnLogin;
	}
	private JButton getBtnRegistrati() {
		if (btnRegistrati == null) {
			btnRegistrati = new JButton("Registrati");
			btnRegistrati.setBounds(227, 167, 117, 29);
		}
		return btnRegistrati;
	}
	private JButton getBtnEsci() {
		if (btnEsci == null) {
			btnEsci = new JButton("Esci");
			btnEsci.setBounds(170, 208, 117, 29);
		}
		return btnEsci;
	}
	private JTextField getTxtUsername() {
		if (txtUsername == null) {
			txtUsername = new JTextField();
			txtUsername.setText("username");
			txtUsername.setBounds(126, 66, 218, 28);
			txtUsername.setColumns(10);
		}
		return txtUsername;
	}
	private JPasswordField getPwdPassword() {
		if (pwdPassword == null) {
			pwdPassword = new JPasswordField();
			pwdPassword.setText("password");
			pwdPassword.setBounds(126, 106, 218, 28);
		}
		return pwdPassword;
	}
	private JLabel getLblTitolo() {
		if (lblTitolo == null) {
			lblTitolo = new JLabel("Benvenuto in \"Esami Online\" .");
			lblTitolo.setBounds(36, 20, 377, 16);
		}
		return lblTitolo;
	}
	private JLabel getLblUsername() {
		if (lblUsername == null) {
			lblUsername = new JLabel("Username");
			lblUsername.setBounds(36, 72, 78, 16);
		}
		return lblUsername;
	}
	private JLabel getLblPassword() {
		if (lblPassword == null) {
			lblPassword = new JLabel("Password");
			lblPassword.setBounds(36, 112, 78, 16);
		}
		return lblPassword;
	}
	private JButton getButton() {
		if (button == null) {
			button = new JButton("?");
			button.setBounds(404, 243, 40, 29);
		}
		return button;
	}
}
